package Base.AbstractTest;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
 * @author 枫城
 * @createTime 2022/9/12 7:32
 * @desc 抽象类 关键字： abstrac
 */
public class AbstractTest {

//    Person person = new Person(); // 'Person' is abstract; cannot be instantiated
}

@Data
@AllArgsConstructor
@NoArgsConstructor
abstract class Person{
    String name;
    int age;

    public void eat() {
        System.out.println("人可以吃！");
    }

    public abstract void walk();
}

class Student extends Person{


    @Override
    public void walk() {
        System.out.println("学生应该多吃有营养东西");
    }
}
